#ifndef CXXOMFORT_CXXOLITERALS_AFFIX_STRING_HPP
#define CXXOMFORT_CXXOLITERALS_AFFIX_STRING_HPP

#include <cxxomfort/base.hpp>
#include "../literals.hpp"
#include <string>
#include <iostream> // for debug

namespace cxxomfort { namespace library { namespace string {
namespace literals {

// operator suffix _s (string)
CXXO_CONSTEXPR const struct _s_t
: public cxxomfort::literals::impl::affix_definition8<std::string, void> 
, public cxxomfort::literals::impl::affix_definition9<std::wstring, void> 
{
	using cxxomfort::literals::impl::affix_definition8<std::string, void>::operator();
	using cxxomfort::literals::impl::affix_definition9<std::wstring, void>::operator();
} s;


#if (CXXOMFORT_CXX_STD >= 2011)

CXXO_GENERATE_AFFIX8_FOR(s);
CXXO_GENERATE_AFFIX9_FOR(s);

/*
inline static std::string operator"" _s (char const* const p, size_t s) {
	return std::string(p, p+s);
}
inline static std::wstring operator"" _s (wchar_t const* const p, size_t s) {
	return std::wstring(p, p+s);
}
*/

#endif

// operator smallcaps

namespace detail {
	const char** fw () {
		static const char* foo[] = {
		"Ａ", "Ｂ", "Ｃ", "Ｄ", "Ｅ", "Ｆ" , 
		"Ｇ", "Ｈ", "Ｉ", "Ｊ", "Ｋ", "Ｌ" , 
		"Ｍ" , "Ｎ" , "Ｏ" , "Ｐ" , "Ｑ" , "Ｒ" , 
		"Ｓ" , "Ｔ" , "Ｕ" , "Ｖ" , "Ｗ" , "Ｘ" , 
		"Ｙ" , "Ｚ" , "[" , "\\" , "]" , "^" ,
		"_", "`", 
		"ａ" , "ｂ" , "ｃ" , "ｄ" , "ｅ" , "ｆ" , 
		"ｇ" , "ｈ" , "ｉ" , "ｊ" , "ｋ" , "ｌ" ,
		"ｍ" , "ｎ" , "ｏ" , "ｐ" , "ｑ" , "ｒ" , 
		"ｓ" , "ｔ" , "ｕ" , "ｖ" , "ｗ" , "ｘ" , 
		"ｙ" , "ｚ"
		};
		return foo;
	}
// ＡＢＣＤＥＦＧＨＩＪＫＬＭＮＯＰＱＲＳＴＵＶＷＸＹＺ＼［＼＼］＼＾＿｀ａｂｃｄｅｆｇｈｉｊｋｌｍｎｏｐｑｒｓｔｕｖｗｘｙｚ

} // detail

const struct fullw_t
: public cxxomfort::literals::impl::affix_definition8<std::string, fullw_t>
{
	template <size_t N>
	return8_type operator() (char const (&p)[N]) const {
		using namespace std;
		std::string S;
		for (size_t i= 0; i < N; ++i) {
			if (p[i]>='A' && p[i]<='z') {
				//size_t pos= p[i] - 'A';
				//cout<< "Checking for '"<< p[i]<< "' pos("<< pos<< ")"<< flush;
				S.append(detail::fw()[p[i]-'A']);
			}
			else S.push_back(p[i]);
		}
		return S;
	}
	
} aesth;



using ::cxxomfort::literals::operator|;



} // literals
} } }

#endif
